fix(desktop): isolate preview shortcuts from the host - #232
Merged
Conversation
Stop forwarding preview chords into the main window, ignore host menu accelerators, and re-enable native editing shortcuts only while the preview guest is focused.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Greptile SummaryThis update isolates Electron preview keyboard input from host application shortcuts while preserving focused native editing commands and preview reload handling. It adds cross-platform coverage for shortcut classification, host isolation, focused editing behavior, and popup guests. Confidence Score: 5/5Safe to merge. No outstanding findings. Reviews (2): Last reviewed commit: "test(desktop): update preview teardown f..." | Re-trigger Greptile |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Keys typed in the in-app browser were forwarded into the host window. Cmd/Ctrl+K, comma, W, and Shift+J ran Akeru actions instead of staying in the page. Isolating those chords with
setIgnoreMenuShortcutsthen blocked native Cut/Copy/Paste/Undo in the guest.Changes
Ignore host menu accelerators for preview guests. Stop synthesizing host key events. Re-enable native editing shortcuts only while that guest is focused, including macOS Paste and Match Style. Cmd/Ctrl+R still reloads the preview.
If a popup is created anyway, apply the same isolation. Akeru still denies
window.openand loads the URL in the same guest.Adapted from pingdotgg#9840 and pingdotgg#10621.
Scope
This PR is preview keyboard isolation only.
Covered here:
Still assigned to this handoff, in later PRs:
Verification
vp test run apps/desktop/src/preview/Manager.test.ts: 78 passed, including host-shortcut isolation and focused editing in tabs plus popups.vp linton the two files: no new errors. Pre-existing unusedNativeImageimport warning remains.Native Cmd/Ctrl editing in a real Electron preview was not run on this Linux host.
Implemented and verified by Grok 4.6 High in Grok Build via Orca.